CC = gcc -pthread -O2 -D_GNU_SOURCE -Wall -Werror

all:ex1a
all:ex1b
all:ex1c

debug: CC += -DDEBUG -g
debug: ex1a
debug: ex1b
debug: ex1c

ex1a: ex1a.o
	$(CC) -o ex1a  ex1a.o

ex1a.o: ex1a.c
	$(CC) -c ex1a.c
	
ex1b: ex1b.o
	$(CC) -o ex1b ex1b.o

ex1b.o: ex1b.c
	$(CC) -c ex1b.c
	
ex1c: ex1c.o
	$(CC) -o ex1c ex1c.o

ex1c.o: ex1c.c
	$(CC) -c ex1c.c
	
clean:
	rm -rf *o ex1a ex1b ex1c